<template>
	<el-tabs v-model="activeName" @tab-click="handleClick">
		<el-tab-pane label="店铺信息" name="first">
			<div style="width: 100%;">
				<div class="shop_item">
					<div class="shop_content" style="max-width: 800px;margin: auto;">
						<div class="content_item">
							<div style="display: flex;align-items: center;margin: 2% 0;">
								<span style="display: inline-block;text-align: left;width: 120px;">店铺logo：</span>
								<div
									style="width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
									<el-upload class="avatar-uploader" v-model="logo"
:action="$http.adornUrlUp('alioss/upload')"
										:show-file-list="false" :on-success="handleAvatarSuccess">
										<img v-if="logo" :src="logo" class="avatar"
											style="width: 148px;height: 148px;border-radius:6px;" />
										<i v-else class="el-icon-plus avatar-uploader-icon"
											style="font-size: 28px;color: #8c939d"></i>
									</el-upload>
								</div>
							</div>
						</div>
						<div class="content_item">
							<div style="display: flex;align-items: center;margin: 2% 0;">
								<span style="display: inline-block;text-align: left;width: 120px;">店铺推广图：</span>
								<div style="display: flex;">
									<div v-for="(item,index) of imgs" style="display: inline-block;">
										<div style="position: relative;margin: 5px;">
											<img :src="item" class="avatar"
												style="width:148px;height: 148px;border-radius: 6px;" />
											<div @click="clear(index)" class="divhove" v-if="imgs">
												<i class="el-icon-delete"
													style="margin: 0;font-size: 18px;color: #fff;"></i>
											</div>
										</div>
									</div>
									<el-upload ref='upload'
:action="$http.adornUrlUp('alioss/upload')"
										list-type="picture-card" :on-success="handleUploadSuccess"
										:on-change="handleChange" :on-remove="handleRemove">
										<i class="el-icon-plus"></i>
									</el-upload>
								</div>
							</div>
						</div>
						<div class="content_item">
							<span style="width: 120px;text-align: left;display:inline-block;">店铺名称:</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15" placeholder="请输入店铺名称"
								v-model="shopName" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" disabled class="margin15" placeholder="请输入店铺名称"
								v-model="shopName" autosize></el-input>
							<span style="color: red;" v-if="!isshow">* 请联系客服修改</span>
						</div>
						<div class="content_item">
							<span>店铺地址:</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15" placeholder="请输入店铺地址"
								v-model="detailedAddress" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" disabled class="margin15" placeholder="请输入店铺地址"
								v-model="detailedAddress" autosize></el-input>
							<span style="color: red;" v-if="!isshow">* 请联系客服修改</span>
						</div>
						<div class="content_item">
							<span style="position: relative;top: -65px;">店铺公告:</span>
							<el-input style="width:50%;" v-if="isshow" type="textarea" :rows="4" disabled
								class="margin15" placeholder="请输入店铺公告" v-model="shopNotice"></el-input>
							<el-input style="width:50%;" v-if="!isshow" type="textarea" :rows="4" class="margin15"
								placeholder="请输入店铺公告" v-model="shopNotice"></el-input>
						</div>
						<div class="content_item">
							<span>开店时间:</span>
							<el-time-select v-model="businessHours" :picker-options="{
								    start: '00:00',
								    step: '00:15',
								    end: '24:00'
								  }" placeholder="选择开店时间" style="width:50%;" v-if="isshow" disabled>
							</el-time-select>
							<el-time-select v-model="businessHours" :picker-options="{
								    start: '00:00',
								    step: '00:15',
								    end: '24:00'
								  }" placeholder="选择开店时间" style="width:50%;" v-if="!isshow">
							</el-time-select>
						</div>
						<div class="content_item">
							<span>闭店时间:</span>
							<el-time-select v-model="lockHours" :picker-options="{
							    start: '00:00',
							    step: '00:15',
							    end: '24:00'
							  }" placeholder="选择闭店时间" style="width:50%;" v-if="isshow" disabled>
							</el-time-select>
							<el-time-select v-model="lockHours" :picker-options="{
							    start: '00:00',
							    step: '00:15',
							    end: '24:00'
							  }" placeholder="选择闭店时间" style="width:50%;" v-if="!isshow">
							</el-time-select>
						</div>
						<div class="content_item">
							<span>配送费(单位:元):</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15" placeholder="请输入配送费(单位:元)"
								v-model="errandMoney" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" disabled class="margin15" placeholder="请输入配送费(单位:元)"
								v-model="errandMoney" autosize></el-input>
							<span style="color: red;" v-if="!isshow">* 请联系客服修改</span>
						</div>
						<div class="content_item">
							<span>最低起送金额(单位:元):</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15" placeholder="请输入最低起送金额(单位:元)"
								v-model="minimumDelivery" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" class="margin15" placeholder="请输入最低起送金额(单位:元)"
								v-model="minimumDelivery" autosize></el-input>
						</div>
						<div class="content_item">
							<span>减免配送费最小订单金额(单位:元):</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15"
								placeholder="请输入减免配送费最小订单金额" v-model="exemptMinMoney" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" class="margin15" placeholder="请输入减免配送费最小订单金额"
								v-model="exemptMinMoney" autosize></el-input>
						</div>
						<div class="content_item">
							<span>最大配送距离(单位:米):</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15" placeholder="请输入最大配送距离(单位:米)"
								v-model="distributionDistance" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" class="margin15" placeholder="请输入最大配送距离(单位:米)"
								v-model="distributionDistance" autosize></el-input>
						</div>
						<div class="content_item">
							<span>营业状态:</span>

							<el-radio-group v-model="putawayFlag" v-if="isshow" disabled>
								<el-radio :label="0">上班啦</el-radio>
								<el-radio :label="1">打烊啦</el-radio>
							</el-radio-group>
							<el-radio-group v-model="putawayFlag" v-if="!isshow">
								<el-radio :label="0">上班啦</el-radio>
								<el-radio :label="1">打烊啦</el-radio>
							</el-radio-group>
						</div>
						<div class="content_item">
							<span>是否开启平台配送:</span>

							<el-radio-group v-model="autoSendOrder" v-if="isshow" disabled>
								<el-radio :label="0">开启</el-radio>
								<el-radio :label="1">关闭</el-radio>
							</el-radio-group>
							<el-radio-group v-model="autoSendOrder" v-if="!isshow">
								<el-radio :label="0">开启</el-radio>
								<el-radio :label="1">关闭</el-radio>
							</el-radio-group>
						</div>
						<div class="content_item">
							<span>是否开启自动接单:</span>

							<el-radio-group v-model="autoAcceptOrder" v-if="isshow" disabled>
								<el-radio :label="0">开启</el-radio>
								<el-radio :label="1">关闭</el-radio>
							</el-radio-group>
							<el-radio-group v-model="autoAcceptOrder" v-if="!isshow">
								<el-radio :label="0">开启</el-radio>
								<el-radio :label="1">关闭</el-radio>
							</el-radio-group>
						</div>
						<div class="content_item">
							<span>打印机:</span>
							<!-- <el-input style="width:50%;" v-if="isshow" disabled class="margin15" placeholder="请输入打印机"
								v-model="facility" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" class="margin15" placeholder="请输入打印机"
								v-model="facility" autosize></el-input> -->
							<el-radio-group v-model="facility" v-if="isshow" disabled>
								<el-radio :label="1">飞鹅</el-radio>
							</el-radio-group>
							<el-radio-group v-model="facility" v-if="!isshow">
								<el-radio :label="1">飞鹅</el-radio>
							</el-radio-group>
						</div>
						<div class="content_item">
							<span>设备SN编码:</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15" placeholder="请输入设备SN编码"
								v-model="snCode" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" class="margin15" placeholder="请输入设备SN编码"
								v-model="snCode" autosize></el-input>
						</div>
						<div class="content_item">
							<span>设备key密钥:</span>
							<el-input style="width:50%;" v-if="isshow" disabled class="margin15"
								placeholder="请输入设备key密钥" v-model="valueKey" autosize></el-input>
							<el-input style="width:50%;" v-if="!isshow" class="margin15" placeholder="请输入设备key密钥"
								v-model="valueKey" autosize></el-input>
						</div>
					</div>
				</div>
				<div class="shop_item" style="text-align:left;margin-left: 20%;">
					<div style="display: inline-block;">
						<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cashJiao(1)">店铺二维码
						</el-button>
						<el-button v-if="isbtn" style="margin-bottom: 20px;" size="mini" type="primary" @click="updates">修改
						</el-button>
					</div>

					<div v-if="!isbtn" style="display: inline-block;">
						<el-button style="margin-bottom: 20px;" size="mini" type="primary" @click="cancel">取消
						</el-button>
						<el-button style="margin-bottom: 20px;" size="mini" type="primary" @click="saveClick">保存
						</el-button>
					</div>
				</div>
			</div>
		</el-tab-pane>
		<el-tab-pane label="店铺收入" name="second">
			<el-select v-model="way" style="width:150px;margin-left: 10px;">
				<el-option v-for="item in ways" :key="item.value" :label="item.label" :value="item.value">
				</el-option>
			</el-select>&nbsp;&nbsp;&nbsp;
			<el-date-picker style="width: 160px;margin-left: 10px;" v-model="info.stockDate" align="right"
				type="datetime" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间" @change="timeDate">
			</el-date-picker>
      <el-button style="margin-bottom: 20px;" size="mini" type="primary" @click="timeDate()">查询
      </el-button>
			</div>
			<el-row v-loading="tableDataLoading1">
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">订单总金额</div>
							<div class="text_color"><span>{{taskStat.money ? taskStat.money : 0}}</span>元</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">订单数量</div>
							<div class="text_color"><span>{{taskStat.count ? taskStat.count : 0}}</span>单</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">到店订单数</div>
							<div class="text_color"><span>{{taskStat.takeCount ? taskStat.takeCount : 0}}</span>单</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">外卖订单数</div>
							<div class="text_color"><span>{{taskStat.takeCount2 ? taskStat.takeCount2 : 0}}</span>单
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">到店订单金额</div>
							<div class="text_color"><span>{{taskStat.takeMoney ? taskStat.takeMoney : 0 }}</span>元</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">外卖订单金额 </div>
							<div class="text_color"><span>{{taskStat.takeMoney1 ? taskStat.takeMoney1 : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">退款订单数</div>
							<div class="text_color">
								<span>{{taskStat.cancelOrderCount ? taskStat.cancelOrderCount : 0}}</span>单
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">退款金额 </div>
							<div class="text_color">
								<span>{{taskStat.cancelOrderMoney ? taskStat.cancelOrderMoney : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
			</el-row>
		</el-tab-pane>
		<el-tab-pane label="钱包明细" name="yue">
			<el-row v-loading="tableDataLoading">
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">总资产</div>
							<div class="text_color"><span>{{tableDataZc.money ? tableDataZc.money : 0}}</span>元</div>
						</div>
					</div>
				</el-col>

			</el-row>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cashTixian">提现
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="tableDataYe.records">

				<el-table-column prop="id" label="编号">
				</el-table-column>
				<el-table-column prop="title" label="标题">
				</el-table-column>
				<el-table-column prop="content" label="内容">
				</el-table-column>

				<el-table-column prop="money" label="金额">
					<template slot-scope="scope">
						<span v-if="scope.row.type==1"
							style="color:limegreen;cursor: pointer;">+{{scope.row.money}}</span>
						<span v-else style="color: red;cursor: pointer;">-{{scope.row.money}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createTime" label="时间">
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChangeYe" @current-change="handleCurrentChangeYe"
					:page-sizes="[10, 20, 30, 50, 100]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next" :total="tableDataYe.total">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="提现记录" name="third">
			<el-table v-loading="tableDataLoading" :data="withdrawData.list">
				<el-table-column fixed prop="id" label="编号" width="80">
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝账号">
				</el-table-column>
				<el-table-column prop="zhifubaoName" label="支付宝名称">
				</el-table-column>
				<el-table-column prop="cashQrCode" label="提现二维码">
					<template slot-scope="scope">
						<img v-if="scope.row.cashQrCode" :src="scope.row.cashQrCode" width="50" height="50" />
					</template>
				</el-table-column>
				<el-table-column prop="money" label="提现金额">
				</el-table-column>
				<el-table-column prop="refund" label="退款原因">
					<template slot-scope="scope">
						<span>{{scope.row.refund ? scope.row.refund : '未退款'}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createAt" label="申请时间" width="170">
				</el-table-column>
				<el-table-column prop="outAt" label="转账/退款时间" width="160">
				</el-table-column>
				<el-table-column prop="orderNumber" label="转账订单号" width="160">
				</el-table-column>
				<el-table-column prop="state" label="状态" width="100">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.state == 0">待转账</span>
						<span v-if="scope.row.state == 1">已转账</span>
						<span v-if="scope.row.state == -1">已拒绝</span>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:page-sizes="[10, 20, 30, 40, 50]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next" :total="withdrawData.totalCount">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="提现账号" name="four">
			<div style="position: relative;margin: 10px 0px;">
				<span>支付宝名称：</span>
				<el-input style="width: 200px;" @keydown.enter.native="shopSelect" placeholder="请输入支付宝名称"
					v-model="tixianData.zhiFuBaoName">
				</el-input>&nbsp;&nbsp
			</div>
			<div style="margin:10px 0;">
				<span>支付宝账号：</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" clearable placeholder="请输入支付宝账号"
					v-model="tixianData.zhiFuBao">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin:10px 0;">
				<span>提现二维码：</span>
				<div
					style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;">
					<el-upload class="avatar-uploader" v-model="tixianData.cashQrCode"
						:action="$http.adornUrlUp('alioss/upload')" :show-file-list="false"
						:on-success="handleAvatarSuccess1">
						<img v-if="tixianData.cashQrCode" :src="tixianData.cashQrCode" class="avatar"
							style="width: 148px;height: 148px;" />
						<i v-else class="el-icon-plus avatar-uploader-icon" style="font-size: 28px;color: #8c939d"></i>
					</el-upload>
				</div>
			</div>
			<!-- <div style="margin:10px 0;">
				<span>开户行：</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" clearable placeholder="请输入开户行"
					v-model="tixianData.bankOfDeposit">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin:10px 0;">
				<span>银行卡号：</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" clearable placeholder="请输入银行卡号"
					v-model="tixianData.bankCardNumber">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin:10px 0;">
				<span>银行卡绑定姓名：</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" clearable placeholder="请输入银行卡绑定姓名"
					v-model="tixianData.bankRealName">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin:10px 0;">
				<span>银行卡绑定手机号：</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" clearable placeholder="请输入银行卡绑定手机号"
					v-model="tixianData.bankPhone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
			</div> -->
			<el-button style="margin:50px;" type="primary" icon="document" @click="querenBtn">确认
			</el-button>
		</el-tab-pane>
		<el-tab-pane label="保证金" name="baozhengjin">
			<el-row v-loading="tableDataLoading">
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">保证金金额</div>
							<div class="text_color"><span>{{cashDeposit ? cashDeposit : 0}}</span>元</div>
						</div>
					</div>
				</el-col>

			</el-row>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cashTui">退保证金
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cashJiao(2)">缴纳保证金
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="tableDataBzj.list">
				<el-table-column fixed prop="id" label="编号" width="80">
				</el-table-column>
				<el-table-column prop="money" label="保证金" width="100">
					<template slot-scope="scope">
						<span style="color: #f56c6c;" v-if="scope.row.type==2">- {{ scope.row.money }}</span>
						<span style="color: #008200;" v-if="scope.row.type==1">+ {{ scope.row.money }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="title" label="标题">
				</el-table-column>
				<el-table-column prop="content" label="内容">
				</el-table-column>
				<el-table-column prop="createTime" label="创建时间" width="150">
				</el-table-column>
				<el-table-column prop="type" label="状态" width="100" fixed="right">
					<template slot-scope="scope">
						<span v-if="scope.row.type == 1">已交保证金</span>
						<span v-if="scope.row.type == 2">已退保证金</span>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChangeYe" @current-change="handleCurrentChangeYe"
					:page-sizes="[10, 20, 30, 50, 100]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next" :total="tableDataBzj.totalCount">
				</el-pagination>
			</div>
		</el-tab-pane>
		<!-- 店铺二维码 -->
		<el-dialog :visible.sync="dialogFormVisible2" center title="店铺二维码">
			<div>
				<img :src="shopQrImg" style="width: 50%;margin-left: 25%;" />
				<div style="text-align: center;margin-top: 20px;">
					<div style="color: red;margin: 10px 0px;" v-if="indexEr==2"> * 请前往移动端进行缴纳</div>
					<el-button type="primary" @click="chakan()">打开窗口查看</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 提现申请 -->
		<el-dialog title="提现申请提示" :visible.sync="dialogFormVisible1" v-loading="tableDataLoading1" center>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">提现类型：</span>
				<el-radio-group v-model="txtype">
					<el-radio :label="1">支付宝</el-radio>
					<el-radio :label="2">微信</el-radio>
					<!-- <el-radio :label="5">银行卡</el-radio> -->
				</el-radio-group>
			</div>
			<el-form :model="tixianData">
				<el-form-item :label-width="formLabelWidth">
					<p>请仔细确认收款人信息</p>
				</el-form-item>
				<el-form-item label="提现金额：" :label-width="formLabelWidth">
					<el-input v-model="outMoney" style="width:65%;" type="number" placeholder="请输入提现金额"></el-input>
				</el-form-item>
				<el-form-item label="支付宝名称：" :label-width="formLabelWidth" v-if="txtype==1">
					<span>{{tixianData.zhiFuBaoName}}</span>
				</el-form-item>
				<el-form-item label="支付宝账号：" :label-width="formLabelWidth" v-if="txtype==1">
					<span>{{tixianData.zhiFuBao}}</span>
				</el-form-item>
				<el-form-item label="开户行：" :label-width="formLabelWidth" v-if="txtype==5">
					<span>{{tixianData.bankOfDeposit}}</span>
				</el-form-item>
				<el-form-item label="银行卡号：" :label-width="formLabelWidth" v-if="txtype==5">
					<span>{{tixianData.bankCardNumber}}</span>
				</el-form-item>
				<el-form-item label="银行卡绑定姓名：" :label-width="formLabelWidth" v-if="txtype==5">
					<span>{{tixianData.bankRealName}}</span>
				</el-form-item>
				<el-form-item label="银行卡绑定手机号：" :label-width="formLabelWidth" v-if="txtype==5">
					<span>{{tixianData.bankPhone}}</span>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible1 = false">取 消</el-button>
				<el-button type="primary" @click="depositTo()">确 定</el-button>
			</div>
		</el-dialog>
	</el-tabs>
</template>
<script>
	export default {
		data() {
			return {
				size: 10,
				page: 1,
				id: '',
				money: '',
				orderNum: '',
				status: 0,
				ordersum0: '',
				ordersum1: '',
				ordersum2: '',
				img: '',
				imgs: [],
				storeId: '',
				isshow: true,
				isbtn: true,
				merchantId: '',
				createTime: '',
				shopData: [],
				orderData: [],
				name: '',
				img: '',
				logo: '',
				startTime: '',
				endTime: '',
				title: '',
				goodsId: '',
				content: '',
				type: '',
				formLabelWidth: 200,
				info: {
					stockDate: this.getNowTime(), //日期
				},
				way: 'day',
				ways: [{
					value: 'day',
					label: '按天查询'
				}, {
					value: 'month',
					label: '按月查询'
				}, {
					value: 'year',
					label: '按年查询'
				}],
				typeId: '',
				value: [],
				status: 0,
				withdrawData: [],
				activeName: 'first',
				tableDataLoading: false,
				dialogFormVisible2: false,
				dialogFormVisible1: false,
				tableData: {},
				tableData2: {},


				tableDataYe: {},
				// ·······
				businessHours: '',
				lockHours: '',
				errandMoney: '',
				minimumDelivery: '',
				exemptMinMoney: '',
				distributionDistance: '',
				autoSendOrder: '',
				autoAcceptOrder: '',
				facility: '',
				snCode: '',
				valueKey: '',
				putawayFlag: '',
				shopName: '',
				businessHours: '',
				lockHours: '',
				detailedAddress: '',
				shopNotice: '店铺开业啦！',
				latitude: '',
				longitude: '',
				shopCover: '',
				shopBanner: '',
				shopId: '',
				exemptMinMoney: '',
				tixianData: {},
				taskStat: {},
				tableDataLoading1: false,
				tableDataBzj: {},
				cashDeposit: 0,
				shopQrImg: '',
				tableDataZc: '',
				txtype: '',
				outMoney: '',
				indexEr:1,
			}
		},
		filters: {
			numFilter(value) {
				let realVal = ''
				if (!isNaN(value) && value !== '') {
					// 截取当前数据到小数点后两位
					realVal = parseFloat(value).toFixed(2)
				} else {
					realVal = '--'
				}
				return realVal
			}
		},
		methods: {
			handleSizeChange(val) {
				this.size = val
				this.withdrawSelect()
			},
			handleCurrentChange(val) {
				this.page = val
				this.withdrawSelect()
			},
			handleSizeChangeYe(val) {
				this.size = val
				this.dataSelectYe()
			},
			handleCurrentChangeYe(val) {
				this.page = val
				this.dataSelectYe()
			},
			handleChange(value) {
				this.value.forEach(element => {
					this.typeId = element;
				});
			},

			//搜索
			select() {
				this.shopSelect()
			},
			// 重置
			cleans() {
				this.title = ''
				this.status = 0
				this.typeId = ''
				this.value = []
				this.shopSelect()
			},


			//处理默认选中当前日期
			getNowTime() {
				var now = new Date()
				var year = now.getFullYear() //得到年份
				var month = now.getMonth() //得到月份
				var date = now.getDate() //得到日期
				month = month + 1
				month = month.toString().padStart(2, '0')
				date = date.toString().padStart(2, '0')
				var defaultDate = `${year}-${month}-${date}`
				return defaultDate
				this.$set(this.info, 'stockDate', defaultDate)
			},
			// 日期选择
			animeDat(value) {
				let vanumber = value
				if (vanumber === 3) {
					this.moneySelect()
					// this.orderSelect()
				}
				if (vanumber === 2) {
					this.moneySelect()
					// this.orderSelect()
				}
				if (vanumber === 1) {
					this.moneySelect()
					// this.orderSelect()
				}
			},
			timeDate() {
				this.moneySelect()
				// this.orderSelect()
			},
			// 商品评价跳转
			discuss(index, rows) {
				this.$router.push({
					path: '/discuss',
					query: {
						goodsId: rows.id
					}
				});
			},
			handleClick(tab, event) {
				if (tab._props.label == '店铺信息') {
					this.dataSelect()
				}
				if (tab._props.label == '店铺收入') {
					this.moneySelect()
					// this.orderSelect2()
				}
				if (tab._props.label == '提现记录') {
					this.withdrawSelect()
				}
				if (tab._props.label == '钱包明细') {
					this.size = 10
					this.page = 1
					this.dataSelectZc()
					this.dataSelectYe()
				}
				if (tab._props.label == '提现账号') {
					this.taskdataSelectZhb()
				}
				if (tab._props.label == '保证金') {
					this.size = 10
					this.page = 1
					this.dataSelectBzjje()
					this.dataSelectBzj()
				}
			},
			// 收入金额统计
			moneySelect() {
				let shopId = this.$cookie.get('shopId')
				this.$http({
					url: this.$http.adornUrl('admin/goodsShop/selectStoreData'),
					method: 'get',
					params: this.$http.adornParams({
						'shopId': shopId,
						// 'startTime': this.startTime,
						// 'endTime': this.endTime
						'date': this.info.stockDate,
						'dateType': this.way
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading1 = false
					let returnData = data.hashMap
					this.taskStat = returnData
				})
			},
			// 获取店铺详情数据
			dataSelect() {
				// this.shopId = this.$cookie.get('shopId')
				let shopId = this.$cookie.get('shopId')
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('app/shop/selectShopMessage'),
					method: 'get',
					params: this.$http.adornParams({
						'shopId': shopId
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.tableData = returnData

					this.shopName = returnData.shopName
					this.businessHours = returnData.businessHours
					this.lockHours = returnData.lockHours
					this.detailedAddress = returnData.detailedAddress
          if(returnData.shopNotice){
            this.shopNotice = returnData.shopNotice
          }else{
            this.shopNotice = '店铺开业啦！'
          }

					this.latitude = returnData.latitude
					this.longitude = returnData.longitude
					this.exemptMinMoney = returnData.exemptMinMoney

					this.shopId = returnData.shopId
					this.logo = returnData.shopCover
					if (returnData.shopBanner) {
						let imgs = returnData.shopBanner.split(',')
						this.imgs = imgs;
					} else {
						this.img = returnData.shopBanner;
					}

					this.businessHours = returnData.businessHours
					this.lockHours = returnData.lockHours
					this.errandMoney = returnData.errandMoney
					this.minimumDelivery = returnData.minimumDelivery
					this.exemptMinMoney = returnData.exemptMinMoney
					this.distributionDistance = returnData.distributionDistance
					this.autoSendOrder = returnData.autoSendOrder
					this.autoAcceptOrder = returnData.autoAcceptOrder
					this.facility = returnData.facility
					this.snCode = returnData.snCode
					this.valueKey = returnData.value
					this.putawayFlag = returnData.putawayFlag

				})
			},
			//上传成功
			handleAvatarSuccess(file, fileList) {
				this.logo = file.data
			},
			// 图标上传
			// handleAvatarSuccess1(file) {
			// 	this.img = file.data;
			// },

			//上传成功
			handleUploadSuccess(file, fileList) {
				this.img = file.data
				this.imgs.push(this.img)
				this.$nextTick(() => {
					this.$refs.upload.clearFiles();
				})
			},
			handleChange(file, fileList) {
				this.hideUpload = fileList.length >= this.limit;
			},
			handleRemove(file, fileList) {
				this.hideUpload = fileList.length >= this.limit;
			},
			// 删除
			clear(index) {
				this.imgs.splice(index, 1);
			},
			// 编辑
			updates() {
				this.isshow = false
				this.isbtn = false
			},
			// 取消
			cancel() {
				this.isshow = true
				this.isbtn = true
			},

			// 保存
			saveClick() {
				this.img = this.imgs.join(',')

				this.$http({
					url: this.$http.adornUrl('app/shop/updateShopMessage'),
					method: 'post',
					data: this.$http.adornParams({
						'shopName': this.shopName,
						'businessHours': this.businessHours,
						'lockHours': this.lockHours,
						'detailedAddress': this.detailedAddress,
						'shopNotice': this.shopNotice,
						'putawayFlag': this.putawayFlag,
						'latitude': this.latitude,
						'longitude': this.longitude,
						'shopCover': this.logo,
						'shopBanner': this.img,
						'shopId': this.shopId,
						'errandMoney': this.errandMoney,
						'minimumDelivery': this.minimumDelivery,
						'exemptMinMoney': this.exemptMinMoney,
						'exemptMinMoney': this.exemptMinMoney,
						'distributionDistance': this.distributionDistance,
						'autoSendOrder': this.autoSendOrder,
						'facility': this.facility,
						'snCode': this.snCode,
						'value': this.valueKey

					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '修改成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.isshow = true
								this.isbtn = true
								this.dataSelect()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}

				})
			},
			// 商户提现记录
			withdrawSelect() {
				this.shopId = this.$cookie.get('shopId')

				this.tableDataLoading = true

				this.$http({
					url: this.$http.adornUrl('shop/shopmoney/selectCashOutList'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.size,
						'shopId': this.shopId
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.withdrawData = returnData
					for (var i in this.withdrawData.list) {
						if (this.withdrawData.list[i].address) {
							this.withdrawData.list[i].address = JSON.parse(this.withdrawData.list[i].address)
						}
					}
				})
			},
			// 获取商品数据
			shopSelect() {
				let storeId = this.$route.query.storeId
				let page = this.page - 1
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('goods/list'),
					method: 'get',
					params: this.$http.adornParams({
						'page': page,
						'size': this.size,
						'title': this.title,
						'type': this.typeId,
						'status': this.status,
						'storeId': storeId
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.shopData = returnData
				})
			},

			// 获取订单数据
			orderSelect() {
				let storeId = this.$route.query.storeId
				let page = this.page - 1
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('orders/list'),
					method: 'get',
					params: this.$http.adornParams({
						'page': page,
						'size': this.size,
						'orderNum': this.orderNum,
						'status': this.status,
						'storeId': storeId,
						'orderType': this.orderType
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.orderData = returnData
				})
			},
			// 订单成交量统计
			orderSelect2() {
				let storeId = this.$route.query.storeId
				let page = this.page - 1
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('orders/statistical'),
					method: 'get',
					params: this.$http.adornParams({
						'data': this.info.stockDate,
						'storeId': storeId
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.ordersum0 = returnData.sum0
					this.ordersum1 = returnData.sum1
					this.ordersum2 = returnData.sum2

				})
			},
			// 钱包金额
			dataSelectZc() {
				let merchantId = this.$route.query.merchantId
				let page = this.page
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('shop/shopmoney/selectShopMoney'),
					method: 'get',
					params: this.$http.adornParams({})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.tableDataZc = returnData

				})
			},
			// 钱包明细
			dataSelectYe() {
				let merchantId = this.$route.query.merchantId
				let page = this.page
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('shop/shopmoney/selectShopMoneydetailsByShopId'),
					method: 'get',
					params: this.$http.adornParams({
						'page': page,
						'limit': this.size,
						'shopId': this.shopId,
						'classify': 3,
						'type': ''
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.tableDataYe = returnData

				})
			},
			// 提现二维码
			handleAvatarSuccess1(file, fileList) {
				this.tixianData.cashQrCode = file.data
				console.log('this.tixianData.cashQrCode', this.tixianData.cashQrCode)
			},
			// 支付宝信息
			taskdataSelectZhb() {
				this.tableDataLoading = true
				this.shopId = this.$cookie.get('shopId')
				this.$http({
					url: this.$http.adornUrl('sys/user/infoByShopId'),
					method: 'get',
					params: this.$http.adornParams({
						'shopId': this.shopId
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.user.userEntity
					this.tixianData = returnData

				})
			},
			querenBtn() {
				if (this.tixianData.zhiFuBaoName == ''||!this.tixianData.zhiFuBaoName) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入支付宝名称',
						type: 'warning'
					})
					return
				}
				if (this.tixianData.zhiFuBao == ''||!this.tixianData.zhiFuBao) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入支付宝账号',
						type: 'warning'
					})
					return
				}
				if (this.tixianData.cashQrCode == ''||!this.tixianData.cashQrCode) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请上传提现二维码',
						type: 'warning'
					})
					return
				}

				this.$http({
					url: this.$http.adornUrl('shop/shopmoney/updateUserByShopId'),
					method: 'post',
					data: this.$http.adornData({
						'zhiFuBao': this.tixianData.zhiFuBao,
						'zhiFuBaoName': this.tixianData.zhiFuBaoName,
						'shopId': this.shopId,
						'cashQrCode': this.tixianData.cashQrCode,
						// 'bankCardNumber': this.tixianData.bankCardNumber,
						// 'bankOfDeposit': this.tixianData.bankOfDeposit,
						// 'bankRealName': this.tixianData.bankRealName,
						// 'bankPhone': this.tixianData.bankPhone,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {

								this.taskdataSelectZhb()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}

				})
			},
			// 保证金
			dataSelectBzj() {
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('admin/shop/selectShopCashDepositList'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.size,
						'shopId': this.shopId
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.tableDataBzj = returnData

				})
			},
			// 保证金金额
			dataSelectBzjje() {
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('app/shop/selectShopMessage'),
					method: 'get',
					params: this.$http.adornParams({
						'shopId': this.shopId
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data;
					this.cashDeposit = data.data.cashDeposit

				})
			},
			// 退保证金
			cashTui() {
				console.log('退保证金')
				if (this.cashDeposit == 0) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '保证金余额0',
						type: 'warning'
					})
					return
				} else {
					this.$http({
						url: this.$http.adornUrl('app/shop/shopRefundCashDeposit'),
						method: 'get',
						params: this.$http.adornParams({
							'shopId': this.shopId
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '申请提交成功，保证金已退还至您的钱包账户',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelectBzjje()
									this.dataSelectBzj()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}
					})
				}
			},
			// 缴纳保证金
			cashJiao(index) {
				// this.shopId = this.$cookie.get('shopId')
				this.indexEr = index
				if(index==1){
this.shopQrImg = this.$http.adornUrlUp('invite/shopQr?shopId=' + this.shopI) 
				}else{
					this.$http({
						url: this.$http.adornUrl('app/common/type/334'),
						method: 'get',
						params: this.$http.adornParams({})
					}).then(({
						data
					}) => {
						this.shopQrImg = data.data.value
					})

				}
				this.dialogFormVisible2 = true


			},
			chakan() {
				window.open(this.shopQrImg, '_blank');
			},
			// 提现
			cashTixian() {
				this.txtype = ''
				this.outMoney = ''
				this.taskdataSelectZhb()
				this.dialogFormVisible1 = true
			},
			// 提现申请
			depositTo() {
				if (this.txtype == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请选择提现方式',
						type: 'warning'
					});
					return
				}
				if (this.txtype == 1) {
					if (this.tixianData.zhiFuBao == null || this.tixianData.zhiFuBao == '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '请先完善支付宝信息',
							type: 'warning'
						});
						return
					}
					if (this.tixianData.zhiFuBaoName == null || this.tixianData.zhiFuBaoName == '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '请先完善支付宝信息',
							type: 'warning'
						});
						return
					}
				}
				if (this.txtype == 5) {
					if (this.tixianData.bankOfDeposit == null || this.tixianData.bankOfDeposit == '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '请先完善银行卡信息',
							type: 'warning'
						});
						return
					}
					if (this.tixianData.bankCardNumber == null || this.tixianData.bankCardNumber == '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '请先完善银行卡信息',
							type: 'warning'
						});
						return
					}
					if (this.tixianData.bankRealName == null || this.tixianData.bankRealName == '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '请先完善银行卡信息',
							type: 'warning'
						});
						return
					}
					if (this.tixianData.bankPhone == null || this.tixianData.bankPhone == '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '请先完善银行卡信息',
							type: 'warning'
						});
						return
					}
				}

				if (this.outMoney > this.tableDataZc.money) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '提现金额不足',
						type: 'warning'
					});
					return
				}
				if (this.outMoney < 1) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '提现金额不能小于1',
						type: 'warning'
					});
					return
				}
				let merchantId = this.$cookie.get('merchantId')
				this.$http({
					url: this.$http.adornUrl('shop/shopmoney/shopCashMoney'),
					method: 'get',
					params: this.$http.adornParams({
						'money': this.outMoney,
						'classify': this.txtype
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '提现申请成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dialogFormVisible1 = false
								this.dataSelectZc()
								this.dataSelectYe()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}
				})
			},
		},
		activated() {
			this.dataSelect()
		}
	};
</script>
<style scoped="scoped">
	.content_item {
		margin-bottom: 20px;
	}

	.content_item span {
		display: inline-block;
		width: 120px;
		text-align: left;
	}

	.box {
		height: 110px;
		padding: 24px;
		border: 1px solid #eee;
		margin: 15px 10px;
	}

	.box_num {
		font-size: 14px;
		color: #66b1ff;
	}

	.box_num .box_color {
		color: #333;
		font-size: 14px;
		margin-bottom: 15px;
	}

	.box_num div span {
		font-size: 20px;
		margin-left: 5px;
	}

	.text_color {
		color: #4f9dec;
	}

	.divhove {
		position: absolute;
		width: 100%;
		height: 100%;
		left: 0;
		top: 0;
		opacity: 0;
		cursor: default;
		text-align: center;
		padding-top: 50%;
		border-radius: 6px;
		background-color: rgba(0, 0, 0, .5);
		-webkit-transition: opacity .3s;
		transition: opacity .3s;
	}

	.el-tag--medium {
		margin-right: 10px;
	}

	.divhove:hover {
		opacity: 0.8;
	}

	.text_color span {
		margin-right: 5px;
	}

	.shop_item {
		margin-top: 60px;
		padding-left: 20px;
	}
</style>
